package com.devicemantra.coordinate.interfaces.queue;

import com.google.appengine.api.labs.taskqueue.Queue;
import com.google.appengine.api.labs.taskqueue.QueueFactory;

public class CQueueFactory {
	
	public static final String SMS_QUEUE = "sms-queue";
	public static final String CALL_QUEUE = "call-queue";
	public static final String EMAIL_QUEUE = "mail-queue";
	public static final String FAX_QUEUE = "fax-queue";
	public static final String DEFAULT_QUEUE = "default";
	
	public static Queue getQueue(String pQueueName)
	{
		Queue lQueue = null;
		if(pQueueName.equals(SMS_QUEUE)) {
			lQueue =  QueueFactory.getQueue(pQueueName);
		}else if(pQueueName.equals(CALL_QUEUE)) {
			lQueue =  QueueFactory.getQueue(pQueueName);
		}else if(pQueueName.equals(EMAIL_QUEUE)) {
			lQueue = QueueFactory.getQueue(pQueueName);
		}else if(pQueueName.equals(FAX_QUEUE)) {
			lQueue = QueueFactory.getQueue(pQueueName);
		}else if(pQueueName.equals(DEFAULT_QUEUE)) {
			lQueue = QueueFactory.getQueue(pQueueName);
		}else {
			System.out.println("CException : No Queue with this name defined");
		}
	return lQueue;	
	}

}
